Systems, methods, and apparatus to perform logic synthesis preserving high-level specification

ABSTRACT

A method and an apparatus to perform logic synthesis preserving high-level specification and to check that a common specification (CS) of two circuits is correct have been disclosed. In one embodiment, the method includes building a circuit N 2  that preserves a predefined specification of a circuit N 1 . In some embodiments, the method includes verifying that N 2  and N 1  indeed implement the same specification and so they are functionally equivalent.

FIELD OF INVENTION

The present invention relates to logic synthesis and verification, and more particularly, to performing logic synthesis preserving high-level specification and verifying that two circuits implement the same specification.

BACKGROUND

In electronic design automation processes, logic synthesis generally refers to the conversion of a high-level specification of a circuit design into a gate-level netlist, which typically describes the components to be used to implement the design and the connections between these components. One example of a high-level specification of the circuit design is a description of the functionality of the design in the register transfer level (RTL), such as description of how data is moved between registers and memory, how data is manipulated (e.g., by adding, by comparing, etc.), where data is stored (e.g., in some registers or memory locations), etc. In general, the RTL description may be written in a hardware description language (HDL). The HDL may handle several levels of abstraction, such as behavioral level, register transfer level, and gate levels. One example of the HDL is Verilog.

The netlist generated by logic synthesis may be written in various formats, such as in graphical format or in textual format, to represent the circuit that implements the high-level specification. Some conventional synthesis tools further optimize different portions of a design for a variety of attributes, such as area, speed, etc. For example, one conventional logic synthesis tool may optimize a portion of a design for area by using the smallest amount of area on a silicon chip while another conventional synthesis tool may optimize a portion of a design for speed by adding or removing some logic gates in the netlist. As a result, multiple netlists to achieve the same functionality described by the high-level specification may be generated for different kinds of optimization.

Furthermore, as new technologies in electronic device processing areb being developed to build smaller, faster, and better integrated circuits, netlists of alternative implementations may be generated by logic synthesis based on different fabrication processing technologies. These alternative implementations of the design may take advantage of some or all of these new technologies. The netlists may use different combinations of logic gates, electronic components, wire, etc. to achieve the same functionality as described in the high-level specification.

To ensure the accuracy of the logic synthesis performed, there is a need to verify that the different netlists indeed achieve the same functionality as specified. In other words, it is desired to have an efficient and accurate methodology to verify that a logic synthesis tool indeed preserves the high-level specification in an alternative implementation of the design.

Currently, a sequential circuit is a network of combinational sub-circuits implementing some next-state functions. If a combinational sub-circuit is large enough, it usually can be further partitioned into smaller sub-circuits. It was shown in Equivalence checking of dissimilar circuits. E. Goldberg, Y. Novikov, International Workshop on Logic and Synthesis, May 28-30, 2003, USA that the knowledge of a high-level level structure of a circuit is crucial for efficient Equivalence Checking (EC). Namely, it was shown that if two combinational circuits N₁,N₂ have a Common Specification (CS), then there exists an efficient procedure for checking their equivalence.

A common specification S of N₁ and N₂ is typically defined as a circuit of multi-valued gates (which may also be referred to as blocks) such that N₁ and N₂ are different implementations of S. An example of a CS is given in FIG. 1. Circuits N₁ 1001 and N₂ 1002 have a 3-block CS 1000 shown on the left. Sub-circuits N₁ ^(i), N₂ ^(i) (where i=1, 2, or 3) are different implementations of the multi-valued block, G_(i) of S. Circuit N_(m) ^(i) (m=1, 2) implements a multi-output Boolean function whose truth table is obtained from that of G_(i) by replacing values of multi-valued variables with their binary codes. So the difference between N₁ ^(i) and N₂ ^(i) is in the choice of binary encodings for the variables of S.

In general, equivalence checking of circuits N₁, N₂ with a common specification S is typically infeasible if the common specification S is unknown. However, if the common specification S is known, then there may exist an efficient procedure for performing the equivalence checking of circuits N₁, N₂. This equivalence checking procedure can be used to design a new class of logic synthesis procedures. In general, a logic synthesis procedure has to verify that the original circuit N₁ and a changed circuit N₂ are functionally equivalent, i.e., to verify the change made from circuits N₁ to N₂. The more powerful this verification procedure is, the richer set of synthesis transformations can be used. So any progress in equivalence checking entails introducing a new class of synthesis transformations.

SUMMARY

The present invention includes a method and an apparatus to perform logic synthesis preserving high-level specification and to check that a common specification (CS) of two circuits is correct. In one embodiment, the method includes building a circuit N₂ that preserves a predefined specification of a circuit N₁, and then verifying that N₂ and N₁ indeed implement the same specification and so they are functionally equivalent. However, the logic synthesis procedure preserving high-level specification and the verification procedure checking if two circuits have the same CS can be used separately.

In some embodiments, building the circuit N₂ comprises deriving a plurality of sub-circuits, each of which is toggle equivalent to the corresponding sub-circuit of the circuit N₁. In another embodiment, verifying that N₁ and N₂ have the same specification and hence are functionally equivalent comprises computing in topological order correlation functions relating the outputs of corresponding sub-circuits of N₁ and N₂.

Other features of the present invention will be apparent from the accompanying drawings and from the detailed description that follows.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like reference indicate similar elements and in which:

FIG. 1 illustrates embodiments of circuits having an exemplary common specification of three blocks;

FIG. 2 illustrates a flow diagram of one embodiment of a process to perform logic synthesis;

FIG. 3 illustrates Definition 13;

FIGS. 4A and 4B illustrate an example of two circuits partitioned into toggle equivalent sub-circuits;

FIG. 5 illustrates a flow diagram of one embodiment of a process to verify a common specification of two given circuits;

FIG. 6 illustrates a flow diagram of one embodiment of a process to build a circuit preserving a predefined specification of a given circuit;

FIG. 7 illustrates an exemplary embodiment of a computing system usable with one embodiment of the present invention; and

FIG. 8 illustrates an exemplary embodiment of a logic synthesis tool usable with one embodiment of the present invention.

DETAILED DESCRIPTION

A method and an apparatus to perform logic synthesis preserving high-level specification and to verify that two circuits implement the same high-level specification are described. In the following description, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known components, structures, and techniques have not been shown in detail in order not to obscure the understanding of this description.

Reference in the patent description to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the patent description do not necessarily all refer to the same embodiment.

FIG. 2 shows a flow diagram of one embodiment of a process to perform logic synthesis and to check that the synthesized and initial circuits implement the same specification. The process is performed by processing logic that may comprise hardware (e.g., circuitry, dedicated logic, etc.), software (such as an EDA tool, operable to run on a general-purpose computer system or a dedicated machine), or a combination of both.

Initially, processing logic builds a circuit N₂ implementing the same specification as initial circuit N₁ (processing block 210). The specification of circuit N₁ is represented as a partitioning of circuit N₁ into sub-circuits. Then processing logic verifies that circuits N₁ and N₂ indeed implement the same specification, and hence, circuits N₁ and N₂ are functionally equivalent (processing block 220). Details of each of the processing blocks 210 and 220 are further discussed below with reference to FIGS. 5 and 6.

However, before going into the details of each of the processing blocks 210 and 220, an overview of the concept of Toggle Equivalence and the relation between toggle equivalence and the notion of CS is now discussed.

Toggle Equivalence of Boolean Functions

In this section, the notion of toggle equivalence is introduced. Toggle equivalent Boolean functions can be considered as different implementations of the same multi-valued function.

Toggle Equivalence of Functions with Identical Sets of Variables

Let f₁:{0,1}^(n)→{0,1}^(m) and f₂: {0,1}^(n)→{0,1}^(k) be m-output and k-output Boolean functions of the same set of variables. Functions f₁ and f₂ are toggle equivalent if f₁(x)≠f₁(x′)<=>f₂(x)≠f₂(x′). Circuits N₁ and N₂ implementing the toggle equivalent functions f₁ and f₂ are called toggle equivalent circuits. This is hereinafter referred to as Definition 1. In other words, the functions f₁ and f₂ are toggle equivalent if for any pair of input vectors x, x′ for which at least one output of f₁ changes (toggles), the same is true for f₂, and vice versa.

Let f be a multi-output Boolean function of n variables. The partition of the set {0,1}^(n) (denoted by Part(f)) consists of the disjoint subsets B₁, . . . , B_(k), such that f(x)=f(x′) if and only if x, x′ are in the same subset B_(i). This is hereinafter referred to as Definition 2.

If f₁ and f₂ are toggle equivalent, there cannot be a pair of vectors x, x′ such that x, x′ are in the same subset of one partition and in different subsets of the other partition. Since f₁ and f₂ are toggle equivalent it is generally impossible that one function produces two identical output assignments while the other function toggles. Consequently, if two Boolean functions f₁ and f₂ are toggle equivalent, then Part(f₁)=Part(f₂). (The equality of partitions means that for each element B_(i) of the partition Part(f₁), there is an element B′_(j) of the partition Part(f₂) such that B_(i)=B′_(j) and vice versa). Similarly, if Part(f₁)=Part(f₂), the f₁, f₂ are toggle equivalent. This proposition is hereinafter referred to as Proposition 1.

Let f₁ and f₂ be toggle equivalent single output Boolean functions. From Proposition 1, it follows that Part(f₁)=Part(f₂). Since f₁, f₂ are single output Boolean functions, Part(f₁) and Part(f₂) each includes two elements. So f₁=f₂ or f₁=˜f₂, where “˜” means negation. This is hereinafter referred to as Proposition 2.

A multi-output Boolean function f is called an implementation of a multi-valued function F if the truth table of f can be obtained from that of F in the following two steps: (1) Replace the values of multi-valued variables of F with their codes (we assume that different values of a variable are assigned different codes); and (2) fill in the empty rows (if any) of the truth table with arbitrary Boolean vectors. There if hereinafter referred to as Definition 3.

Suppose f₁ and f₂ are toggle equivalent. According to Proposition 1, Part(f₁)=Part(f₂). Furthermore, suppose Part(f₁), Part(f₂) each includes k elements. Then f₁ and f₂ are implementations of the function F: {0,1}^(n)→{1, . . . , k}, where F(x)=m, if and only if x is in the m-th element of the partition Part(f₁). From Definition 3, it follows that f₁ and f₂ are two different implementations of the same multi-valued function of Boolean variables. This in hereinafter referred to as Proposition 3.

Proposition 3 is of great importance because it shows how one can reencode multi-valued variables implicitly. Suppose, a multi-output circuit N₁ implements a multi-valued function F whose output is described by a multi-valued variable Y. Suppose one needs to reencode the values Y to get a better implementation of F. Proposition 3 shows that by synthesizing a circuit N₂ that is toggle equivalent to N₁, one can obtain a new implementation of F. That is the values of the variable Y are reencoded implicitly without even knowing the binary encodings used to encode the values of Y to obtain N₁ and N₂ from F.

Toggle Equivalence of Functions with Different Sets of Variables

In this subsection, the notion of toggle equivalence is extended to the case of Boolean functions with different sets of variables that are related by constraint functions.

Let X and Y be two disjoint sets of Boolean variables, where the number of variables in X and Y may be different. A Boolean function is denoted by Cf(X,Y} if this function satisfies the following two conditions: (1) There are no three vectors x, x′, y (where x, x′ are assignments to variables X and y is an assignment to variables Y) such that x≠x′ and Cf(x, y)=Cf(x′, y)=1; and (2) there are no three vectors x, y, y′ such that y≠y′ and Cf(x, y)=Cf(x, y′)=1. This is hereinafter referred to as Definition 4. The function Cf may be referred to as a correlation function.

A correlation function specifies a mapping between two different encodings of the same multi-valued variable. Suppose V={x₁, . . . , x_(p)} is the set of all assignments to the variable of X such that Cf(x_(i), y)=1 for some y. Let W={y₁, . . . , y_(m)} be the set of all assignments to variable of Y such that Cf(x, y_(i))=1 for some x. From the above definition of the correlation function, it follows that |W|=|V| (and so m=p) and there exists a natural bijective mapping between V and W that relates a vector x_(i) of V and the vector y_(j) of W for which Cf(x_(i), y_(j))=1. The vectors x_(i) and y_(i) can be considered as the codes of the same value of a p-valued variable. This is hereinafter referred to as Remark 1.

Furthermore, let Cf(X,Y) be a Boolean function and X,Y be two sets of Boolean variables. Checking if Cf is a correlation function may include two satisfiability checks. First, checking the condition (1) in the definition of Cf may include testing the satisfiability of the expression, Cf(X,Y)^Cf(X′,Y′)^Neq(X,X′)^Eq(Y,Y′). Here, Cf(X′,Y′) is a copy of Cf(X,Y), where variables of X′,Y′ are independent of those of X,Y. Neq(x, x′) is equal to 1 if and only if x≠x′. The function Eq(Y,Y′) is the negation of Neq(Y,Y′). Second, checking the condition (2) in the definition of Cf may include testing the satisfiability of Cf(X,Y)^Cf(X′,Y′)^Eq(X,X′)^Neq(Y,Y′). If both expressions are constant 0, then Cf is a correlation function. This is hereinafter referred to as Remark 2.

Let f₁:{0,1}^(n)→{0,1}^(m) and f₂:{0,1}^(p)→{0,1}^(k) be m-output and k-output Boolean functions and X, Y specify their sets of Boolean variables, where |X|=n and |Y|=p. Further suppose that D_(inp)(X,Y) is a Boolean function. The functions f₁ and f₂ are called toggle equivalent under the constraint function D_(inp)(X,Y) if (f₁(x)≠f₁(x′)^(D_(inp)(x,y)=D_(inp)(x′, y′)=1))=>(f₂(y)≠f₂(y′), and vice versa, i.e., (f₂(y)≠f₂(y′)^ (D_(inp)(x,y)=D_(inp)(x′, y′)=1))=>f₁(x)≠f₁(x′). This definition is hereinafter referred to as Definition 5.

Let X,Y be two sets of Boolean variables and {X₁, . . . , X_(s)} and {Y₁, . . . , Y_(s)} be the partitions of X and Y, respectively. Let Cf(X₁, Y₁), . . . , Cf(X_(s), Y_(s)) be correlation functions. Suppose f₁(X) and f₂(Y) are toggle equivalent under the constraint function D_(inp)(X,Y)=Cf(X₁,Y₁)^ . . . ^Cf(X_(s),Y_(s)). As discussed above (see Proposition 3), the two toggle equivalent functions, f₁ and f₂, are two different implementations of the same multi-valued function of Boolean variables. Furthermore, taking into account of Remark 1 above, it follows that f₁ and f₂ are implementations of the same multi-valued function of s multi-valued variables. This proposition is hereinafter referred to as Proposition 4.

Testing Toggle Equivalence

Suppose N is a Boolean circuit. The set denoted by v(N) consists of the Boolean variables each of which is associated with either the output of a gate or a primary input of N. The Boolean function denoted by Sat(v(N)) satisfies the condition that Sat(z)=1 if and only if the assignment z to the variables v(N) is possible, i.e., consistent. For example, if circuit N consists of just one AND gate described by y=x₁^x₂, then v(N)={y, x₁, x₂} and Sat(v(N))=(˜x₁

_(˜x) ₂

y)^(x₁

˜y)^(x₂

˜y). This is hereinafter referred to as Definition 6.

Furthermore, suppose f is a Boolean function. The function f* is obtained from f by existentially quantifying away the variable x if f*=f( . . . , x=0, . . . )

f( . . . , x=1, . . . ). This is hereinafter referred to as Definition 7.

Let N₁ and N₂ be Boolean circuits whose inputs are specified by sets of variables X and Y respectivley. Let D_(inp)(X,Y) be a constraint Boolean function that is also a correlation function. A Boolean function is denoted by D_(out)(N₁,N₂) if it is obtained from the function H, where H=Sat(v(N₁))^Sat(v(N₂))^D_(inp)(X,Y), by existentailly quantifying away all the variables of H but the output variables of N₁ and N₂. This is hereinafter referred to as Definition 8.

Let N₁ and N₂ be circuits that are toggle equivalent under a constraint Boolean function D_(inp)(X,Y) that is also a correlation function. Let D_(out)(N₁, N₂) be the function obtained from H=Sat(v(N₁))^Sat(v(N₂))^D_(inp)(X,Y) as described in Definition 8 above. Then D_(out)(N₁,N₂) satisfies either condition of Definition 4 and hence it is a correlation function. For example, there cannot exist Boolean vectors z, z′ and h (where z≠z′ and z, z′ are output assignments of N₁ and h is an output assignment of N₂) such that D_(out)(z,h)=D_(out)(z′,h)=1. Indeed, it would mean that there exist pairs of vectors x, y and x′, y′ such that a) z=N₁(x), z′=N₂(x′) and h=N₂(y)=N₂(y′);b) D_(inp)(x, y)=1 and D_(inp)(x′,y′)=1; c) x≠x′ and y≠y′; d) N₁(x)≠N₁(x′) while N₂(y)=N₂(y′). But this is impossible since N₁ and N₂ are toggle equivalent. In the same way, it can be shown that if one replaces the assumption that N₁ and N₂ are toggle equivalent with the assumption that D_(out) is a correlation function, then N₁ and N₂ can be proven to be toggle equivalent. In other words, circuits N₁, N₂ whose inputs are constrained by a correlation function D_(out)(N₁, N₂) are toggle equivalent if and only if the function D_(out)(N₁, N₂) is a correlation function. This is hereinafter referred to as Proposition 5.

Common Specification and Toggle Equivalence

The existence of a CS for the combinational circuits N₁ and N₂ implies that N₁, N₂ can be partitioned into toggle equivalent sub-circuits that are coupled in N₁ and N₂ in the same way. Although the technique described in the current document is illustrated with a specification of a circuit N that is represented as a partition, one should appreciate that the technique may also be applied to specifications that are represented as coverings. The difference between a partition and a covering is that in the case of a partition, a logic gate may be included in only one of the sub-circuits, whereas in the case of a covering, a logic gate may be shared by more than one sub-circuit. For example, suppose that a specification Spec(N) of a circuit N is given by the sub-circuits N₁, . . . , N_(k) and Spec(N) satisfies the following properties: (1) each gate of N is in at least one sub-circuit N_(i); and (2) two different sub-circuits N_(i), N_(j) may share only internal gates (see Definition 10 below), then Spec(N) here is represented as a covering.

Let N=(V,E) be a Directed Acyclic Graph (DAG) representing a Boolean circuit, where V, E are sets of nodes and edges of N respectively. A subgraph N*=(V*,E*) of N is called a sub-circuit if the following two conditions are met: (a) If g₁,g₂ are in V* and there is a path from g₁ and g₂ in N, then all the nodes of N on that path are in V*; and (b) if g₁,g₂ of V* are coupled by an edge in N, then they are also coupled by an edge in N*. This definition is hereinafter referred to as Definition 9.

Let N* be a sub-circuit of N. An input of a gate g of N* is called an input of N* if it is not coupled to the output of some other gate of N*. A gate g of N* is called an internal gate if all the gates of N whose inputs are fed by the output of g are in N*. Otherwise, g is called an external gate. The output of an external gate is called an output of circuit N*. This definition is hereinafter referred to as Definition 10.

Let a Boolean circuit N be partitioned into k sub-circuits N¹, . . . , N^(k). Let T be a directed graph of k nodes such that nodes G_(i) and G_(j) of T are connected by a directed edge (from n_(i) to n_(j)) if and only if an output of N^(i) is connected to an input of N^(k) in N. T is called the communication specification corresponding to the partition N¹, . . . , N^(k). The partition N¹, . . . , N^(k) is called topological if T is a DAG (i.e., if T does not contain cycles). This definition is hereinafter referred to as Definition 11.

Let T be the communication specification of the circuit N with respect to the topological partition N¹, . . . , N^(k). Let G_(i) be the node of T corresponding to the sub-circuit N^(i). The length of the longest path from an input of T to G_(i) is called the level of G_(i) and N^(i) (denoted by level(G_(i)) and level(N^(i)) respectively). This definition is hereinafter referred to as Definition 12.

Let N₁ ¹, . . . , N₁ ^(k) and N₂ ¹, . . . , N₂ ^(k) be the topological partitions of two single output Boolean circuits N₁, N₂, respectively. Let the communication specifications of N₁ and N₂ with respect to the partitions N₁ ¹, . . . , N₁ ^(k) and N₂ ¹, . . . , N₂ ^(k) be identical. D_(out)(N₁ ^(m),N₂ ^(m)), where m=1, . . . , k, are functions computed by induction in topological levels. This definition is hereinafter referred to as Definition 13. Namely, the functions D_(out) for the sub-circuits on level 1 are first computed, then for those on level 2 are computed, and so on. The function D_(out)(N₁ ^(m),N₂ ^(m)) may be obtained from the function H=Sat(v(N₁ ^(m)))^Sat(v(N₂ ^(m)))^D_(inpu)(N₁ ^(m),N₂ ^(m)) by existentially quantifying away all the variables except the output variables of N₁ ^(m), N₂ ^(m). The function D_(inp)(N₁ ^(m),N₂ ^(m)) may be equal to D_(out)(N₁ ^(i1),N₁ ^(i1))^ . . . ^D_(out)(N₁ ^(is),N₂ ^(is))^Eq(x_(i1),y_(i1))^ . . . ^Eq(x_(ir),y_(ir)). Note that N₁ ^(i1), . . . , N₁ ^(is), . . . , N₂ ^(i1), . . . , N₂ ^(is) are the s sub-circuits (if any) whose outputs are coupled to the inputs of N₁ ^(m),N₂ ^(m), respectively. (FIG. 3 shows circuits N₁ ^(m), N₂ ^(m) and the subcircuits and primary inputs connected to inputs of N₁ ^(m), N₂ ^(m).) Variables x_(i1), . . . , x_(ir), y_(i1), . . . , y_(ir) are the r primary input variables of N₁ and N₂ (if any) that feed N₁ ^(m) and N₂ ^(m), respectively. The function, Eq(x_(it),y_(it)), where 1≦t≦r, is equal to 1 if and only if x_(it) is equal to y_(it).

Let N₁, N₂ be two functionally equivalent single output circuits. Let T be a DAG of k nodes. Circuits N₁ and N₂ are implementations of a specification S (represented as a partitioning of N₁ and N₂) whose topology is given by T if and only if there is a partitioning, Spec(N₁)={N₁ ¹, . . . , N₁ ^(k)} of N₁ and a partitioning Spec(N₂)={N₂ ¹, . . . , N₂ ^(k)} of N₂ into k sub-circuits such that (1) the communication specifications T₁, T₂ of N₁ and N₂ with respect to the partitionings, Spec(N₁), Spec(N₂) are equal to T; and (2) each pair of the sub-circuits N₁ ^(m), N₂ ^(m) is toggle equivalent under the constraint function D_(inp)(N₁ ^(m),N₂ ^(m)) specified above. This proposition is hereinafter referred to as Proposition 6.

Proposition 6 may be proven by induction (in levels) using Propositions 4 and 5. Furthermore, the “only if” part may be proven by induction using the fact that two Boolean functions implementing the same multi-valued function are toggle equivalent.

An example of circuits with a CS of three blocks is shown in FIGS. 4A and 4B. Circuit N₁ 401 (at the top) and N₂ 402 (at the bottom) have the same communication specification 1000 (shown in FIG. 1 on the left side). Sub-circuits N₁ ¹, N₁ ² (outlined by the dotted lines 4011 and 4012, respectively) are toggle equivalent to sub-circuits N₂ ¹, N₂ ² (outlined by the dotted lines 4021 and 4022, respectively) respectively in terms of their inputs related by the constraint functions D_(inp(N) ₁ ¹, N₂ ¹)=Eq(x₁, y₁)^Eq(x₂, y₂)^Eq(x₃, y₃) and D_(inp)(N₁ ², N₂ ²)=Eq(x₃, y₃)^Eq(x₄, y₄)^Eq(x₅, y₅) respectively. Sub-circuits N₁ ³ and N₂ ³ (outlined by the dotted lines 4013 and 4023, respectively) are toggle equivalent in terms of their local inputs related by the constraint function D_(inp)(N₁ ³, N₂ ³)=D_(out)(N₁ ¹, N₂ ¹)^D_(out)(N₁ ², N₂ ²). The functions D_(out)(N₁ ¹, N₂ ¹), D_(out)(N₁ ², N₂ ²) are obtained as described in Definition 13. In other words, when the same set of inputs is provided to both circuits N₁ 401 and N₂ 402, their corresponding outputs Z₁ and Z₂ are the same.

With the concept of toggle equivalence and common specification in mind, some embodiments of a process to verify a common specification of two circuits and some embodiments of a process to build a circuit to preserve a predefined specification of another circuit are described below.

Common Specification Verification

FIG. 5 shows a flow diagram of one embodiment of a process to verify a common specification of two given circuits, N₁ and N₂. Note that specifications of N₁ and N₂ have the same number of sub-circuits. The process is performed by processing logic that may comprise hardware (e.g., circuitry, dedicated logic, etc.), software (such as a logic synthesis tool, operable to run on a general-purpose computer system or a dedicated machine), or a combination of both.

In one embodiment, the process starts with topological partitions, Spec(N₁) and Spec(N₂), of the two circuits, N₁ and N₂, respectively. Alternatively, the process may start with the coverings of N₁ and N₂. Processing logic computes communication specifications, T₁ and T₂, for N₁ and N₂, respectively (processing block 102). Then processing logic checks if T₁ and T₂ are acyclic (processing block 104). If T₁ and T₂ are cyclic, processing logic transitions to processing block 124 to end the process. Otherwise, processing logic checks if T₁ and T₂ are identical (processing block 106). If T₁ and T₂ are not identical, then processing logic transitions to processing block 124 to end the process. Otherwise, processing logic enters into a loop to go through each sub-circuit of Spec(N₁) and Spec(N₂). Note that Spec(N₁) and Spec(N₂) have the same number of sub-circuits. The sub-circuits of Spec(N₁) and Spec(N₂) are assumed to be numbered in topological order. That is, for any two sub-circuits N₁ ^(i), N₁ ^(j) of Spec(N₁), if i<j, then level(N₁ ^(i))≦level(N₁ ^(j)). And for any two sub-circuits N₂ ^(i),N₂ ^(j) of Spec(N₂), if i<j, then level(N₂ ^(i))≦level(N₂ ^(j)).

In one embodiment, processing logic initiates the loop by setting an index, i, to 1, where i corresponds to the pair of sub-circuits N₁ ^(i) and N₂ ^(i) being analyzed in circuits N₁ and N₂ (processing block 108). Then processing logic computes a constraint function D_(inp) that relates the inputs of the sub-circuits N₁ ^(i) and N₂ ^(i) (processing block 110). Processing logic further computes a function, D_(out) that relates the outputs of the sub-circuits N₁ ^(i) and N₂ ^(i) (processing block 112). Then processing logic checks if D_(out) is a correlation function (processing block 114). If D_(out) is not a correlation function, and hence, N₁ ^(i) and N₂ ^(i) are not toggle equivalent, processing logic transitions to processing block 124 to end the process. Otherwise, processing logic checks whether the index, i, is less then k, where k is the total number of sub-circuits in Spec(N₁) and Spec(N₂) (processing block 116). If i is less than k, then processing logic increments i by one (processing block 118) and then repeats processing block 110.

If i is not less than k, then the loop has been completed and processing logic checks whether D_(out)(N₁ ^(k), N₂ ^(k)) implies equivalence function (processing block 120). If not, processing logic transitions to processing block 124 to end the process and concludes that Spec(N₁) and Spec(N₂) are not identical. On the other hand, if D_(out)(N₁ ^(k), N₂ ^(k)) implies equivalence function, then processing logic has successfully verified that Spec(N₁) and Spec(N₂) are identical and N₁ and N₂ are equivalent and the process ends (processing block 122).

The technique described above efficiently checks for equivalence of N₁ and N₂. As shown above, N₁ and N₂ share the same common specification (specified as a partitioning) if and only if N₁ and N₂ can be partitioned into sub-circuits that are connected in the same way and are toggle equivalent. The above technique allows logic synthesis to verify that different netlists generated indeed preserve a predetermined high-level specification. As described above, this is important for logic synthesis because logic synthesis may generate multiple different netlists in a variety of situations, such as in optimization for speed, optimization for area, switching from one fabrication process to another fabrication process, etc.

Let N₁, N₂ be two functionally equivalent circuits with a CS S represented by the partitions Spec(N₁)={N₁ ¹, . . . , N₁ ^(k)}, and Spec(N₂)={N₂ ¹, . . . , N₂ ^(k)}. The granularity of S is the size (i.e., the number of gates) of the largest sub-circuit N₁ ^(j), i=1,2, j=1, . . . , k. This is hereinafter referred to as Definition 14.

In some embodiments, the CS verification procedure is exponential in the granularity p of S and linear in the number of blocks of S, i.e., in the number of sub-circuits in Spec(N₁), Spec(N₂). (The exponentiality in p is due to existential quantification and the procedure to perform the correlation function.) If the value of p is fixed, the CS verification procedure proves the equivalence of specifications represented by Spec(N₁) and Spec(N₂) (and hence functional equivalence of N₁ and N₂) in linear time in the circuit size.

Comparison of Equivalence Checking Based on Specification Verification with Existing Equivalence Checkers

Note that the efficiency of the CS verification procedure is due to the fact that a CS specification of N₁ and N₂ (represented by Spec(N₁) and Spec(N₂)) is known. On the other hand, one can view state-of-the art equivalence checkers as procedures looking for a CS of N₁ of N₂ of a special kind. Such procedures try to find pairs of functionally equivalent points of N₁, N₂ and use them as cutpoints. Then these procedures look for new points of N₁, N₂ that are functionally equivalent in terms of cutpoints. The reason for looking for cutpoints is that checking functional equivalence of internal points of N₁, N₂ in terms of cutpoints is much easier than in terms of primary inputs. In general, this approach has the following two problems. The first problem is to find the new potential cutpoints (i.e., to find points of N₁, N₂ that are functionally equivalent). The second problem is to decide whether two functionally equivalent internal points can be used as cutpoints. Making a wrong decision here leads to the appearance of the so-called false negatives.

One can view the cut advancement approach employed by modern equivalence checkers as a search for a CS of N₁, N₂ of a special type, where very sub-circuit of Spec(N₁) and Spec(N₂) has exactly one output. However, if one tries to extend this approach to CSs of the general type (where sub-circuits of Spec(N₁) and Spec(N₂) may have many outputs), the two problems mentioned above may become virtually unsolvable. In the case of multi-output sub-circuits, functional equivalence is replaced with toggle equivalence. Suppose the granularity p of a CS of N₁, N₂ is 10. So the sub-circuits of Spec(N₁) and Spec(N₂) to be considered may have up to 10 outputs. Then the number of candidate sub-circuits in N₁ and N₂ is proportional to |N₁|¹⁰ and |N₂|¹⁰, respectively, where |N_(j)| is the size of N_(j) (j=1 or 2). The number of potential pairs of sub-circuits of N₁, N₂ to examine is proportional to |N₁|¹⁰*|N₂|¹⁰. But even if a pair of sub-circuits N₁ ^(i), N₂ ^(i) of size less or equal to 10 that are toggle equivalent has been found, one still has to decide if the outputs of N₁ ^(i), N₂ ^(i) can be used as cutpoints. That is, one has to decide whether N₁ ^(i), N₂ ^(i) are toggle equivalent “by chance” or N₁ ^(i), N₂ ^(i) are a part of a CS. Since the number of candidates is typically huge, the process is prone to mistakes.

Since finding a CS of N₁, N₂ in the case Spec(N₁) and Spec(N₂) contain multi-output sub-circuits is infeasible, in the equivalence checking procedure described in the current document, a CS of N₁, N₂ is required to be known. This makes this procedure efficient.

Specification Preservation

FIG. 6 illustrates a flow diagram of one embodiment of a process to build a second circuit to preserve a predefined specification of a first circuit. The process may also be referred to as specification preservation (SP). The process is performed by processing logic that may comprise hardware (e.g., circuitry, dedicated logic, etc.), software (such as a logic synthesis tool, operable to run on a general-purpose computer system or a dedicated machine), or a combination of both.

In one embodiment, processing logic starts the process with the first circuit, N₁, the topological partition of N₁, (Spec(N₁)={N₁ ¹, . . . , N₁ ^(k)}), and the cost function to optimize during synthesis (processing block 410). Spec(N₁) has k sub-circuits and processing logic goes through each sub-circuit in a loop. To initiate the loop, processing logic may set an index, i, to be one, where i corresponds to the sub-circuit of Spec(N₁) being analyzed (processing block 420). The sub-circuits of Spec(N₁) are assumed to be numbered in topological order. That is, for any two sub-circuits N₁ ^(i), N₁ ^(j) of Spec(N₁), if i<j, then level(N₁ ^(i))≦level(N₁ ^(j)).

In each iteration of the loop, processing logic performs several operations to build a portion of the second circuit, N₂. In one embodiment, processing logic builds a constraint function D_(inp) that relates the inputs of N₁ ^(i) and N₂ ^(i) (processing block 423). Then processing logic may synthesize N₂ ^(i), which is toggle equivalent to N₁ ^(i), taking into account of the cost function (processing block 425). Processing logic may further compute a function, D_(out) that relates the outputs of N₁ ^(i) and N₂ ^(i) based on D_(inp) (processing block 427). D_(out) is a correlation function because N₁ ^(i) nad N₂ ^(i) are toggle equivalent. Then processing logic may check whether i is greater than k, where k is the total number of sub-circuits in Spec(N₁) (processing block 428). If i is less than k, then processing logic may increment i by one (processing block 429) and repeat processing block 423. Otherwise, processing logic has gone through every sub-circuit of Spec(N₁). Thus, processing logic may transition to processing block 430 to end the process by returning N₂ and the topological partition of N₂ represented by Spec(N₂).

The importance of some embodiments of the SP procedure is twofold. First, the complexity of the SP procedure is the same as that of the CS verification procedure. Namely, it is exponential in the granularity p of the CS of N₁, N₂ represented by Spec(N₁), Spec(N₂) and linear in the number of sub-circuits in Spec(N₁) and Spec(N₂), assuming that the synthesis of N₂ ^(i) is exponential in p. This means that if p is fixed, the SP procedure is linear in circuit size, and hence, the SP procedure is scalable.

Second, the SP procedure may allow one to make a trade-off between optimization quality and efficiency. Note that the search space explored by the SP procedure may be limited to the implementation of the specification of N₁ represented by Spec(N₁). The smaller the granularity p of the specification S of N₁ is, the smaller the search space is and the greater the efficiency of the SP procedure is. So, if no good alternative implementation N₂ is found for the current specification of N₁, one can merge some adjacent sub-circuits of Spec(N₁) to get a specification of larger granularity. With a specification of larger granularity, the search space may become larger at the expense of performance of the SP procedure.

Furthermore, even for a specification of small granularity, the space of implementations is very rich. The expression, (2^(p))!, gives the number of different binary encodings of length p for a 2^(p)-valued variable. Note that the value of (2^(p))! is huge even for a very small p. This expression may provide a ballpark estimate of the number of functions that are toggle equivalent to a p-output Boolean function.

Note that in the examples described above, combinational circuits are used to illustrate the concepts of toggle equivalence and common specification, however, one should appreciate that these concepts can be applied to the synthesis of sequential circuits as well.

FIG. 7 illustrates a computing system that may be used to perform some or all of the processes according to some embodiments of the invention. In one embodiment, the computing system 500 includes a processor 510 and a memory 520, a removable media drive 530, and a hard disk drive 540. In one embodiment, the processor 510 executes instructions residing on a machine-readable medium, such as the hard disk drive 540, a movable medium (e.g., a compact disk 501, a magnetic tape, etc.), or a combination of both. The instructions may be loaded from the machine-readable medium into the memory 520, which may include Random Access Memory (RAM), dynamic RAM (DRAM), etc. The processor 510 may retrieve the instructions from the memory 520 and execute the instructions to perform operations described above.

Note that any or all of the components and the associated hardware illustrated in FIG. 7 may be used in various embodiments of the system 500. However, it should be appreciated that other configurations of the system 500 may include more or less devices than those shown in FIG. 7.

FIG. 8 illustrates an exemplary embodiment of a logic synthesis tool usable with one embodiment of the present invention. The logic synthesis tool 800 includes several modules, which may be implemented using software, hardware, or a combination of both. The modules shown in FIG. 8 include a logic synthesis module 811, an optimization and timing analysis module 813, and a graphical user interface (GUI) module 815. Note that various embodiments of the logic synthesis tool may include more or fewer modules than those illustrated in FIG. 8. The logic synthesis tool 800 receives a high-level specification of a circuit design, such as the RTL specification 801, as an input. The RTL specification 801 may be written in a hardware description language (HDL), such as Verilog. In addition to the high-level specification, the logic synthesis tool 800 also receives data from a number of libraries 803, such as standard cell libraries, which describes the specific details of some circuit components (e.g., NAND gate, NOR gate, etc.) specific to a predetermined semiconductor fabrication process. The logic synthesis tool 800 outputs a gate-level netlist 820, which may contain description of the circuit components and the connection of the circuit components to implement the RTL specification 801.

In one embodiment, the logic synthesis module 811 performs logic synthesis on the RTL specification 801 to generate the gate-level netlist 820 based on the RTL specification 801 and the data from the libraries 803. The optimization and timing analysis module 813 may further optimize an intermediate gate-level netlist from the logic synthesis module 311 before the netlist 820 is output. In some embodiments, the optimization and timing analysis module 813 performs timing analysis as part of the process to optimize the intermediate gate-level netlist. The GUI module 815 may generate one or more graphical user interface to receive inputs (e.g., constraints, instructions, etc.) from users, where such inputs may be used to control or modify the operations performed by the logic synthesis module 811.

Some portions of the preceding detailed description have been presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the tools used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, conceived to be a self-consistent sequence of operations leading to a desired result. The operations are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.

It should be kept in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the above discussion, it is appreciated that throughout the description, discussions utilizing terms such as “processing” or “computing” or “calculating” or “determining” or “displaying” or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.

The present invention also relates to an apparatus for performing the operations described herein. This apparatus may be specially constructed for the required purposes, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer readable storage medium, such as, but is not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, and magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a computer system bus.

The processes and displays presented herein are not inherently related to any particular computer or other apparatus. Various general-purpose systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct a more specialized apparatus to perform the operations described. The required structure for a variety of these systems will appear from the description below. In addition, the present invention is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the invention as described herein.

A machine-readable medium includes any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer). For example, a machine-readable medium includes read only memory (“ROM”); random access memory (“RAM”); magnetic disk storage media; optical storage media; flash memory devices; electrical, optical, acoustical or other form of propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.); etc.

The foregoing discussion merely describes some exemplary embodiments of the present invention. One skilled in the art will readily recognize from such discussion, the accompanying drawings and the claims that various modifications can be made without departing from the spirit and scope of the invention. 

1. A method of circuit synthesis for integrated circuit design, the method comprising: building a first circuit N₁ partitioned into a first plurality of sub-circuits corresponding to a specification, wherein the specification specifies the partitioning of the first circuit N₁ into sub-circuits and the connectivity of the sub-circuits; deriving a plurality of toggle equivalent sub-circuits respectively corresponding to the first plurality of sub-circuits of the first circuit N₁; and building a second circuit N₂ using the plurality of toggle equivalent sub-circuits in response to the specification, wherein the plurality of toggle equivalent sub-circuits form a partitioning of the second circuit N₂ corresponding to the specification and the partitioning of the first circuit N₁ into sub-circuits.
 2. The method of claim 1, wherein deriving the plurality of toggle equivalent sub-circuits comprises: for each of the first plurality of sub-circuits of the first circuit N₁: building a constraint function that relates one or more inputs of the corresponding sub-circuit to one or more inputs of the corresponding toggle equivalent sub-circuit of the second circuit N₂; synthesizing the next toggle equivalent sub-circuit of the second circuit N₂ based on the constraint function and a cost function; and computing a correlation function that relates outputs of the corresponding sub-circuit of the first circuit N₁ and outputs of the toggle equivalent sub-circuit of the second circuit N₂.
 3. The method of claim 2, wherein the correlation function is computed in response to the constraint function.
 4. The method of claim 1, wherein complexity of the deriving of the plurality of toggle equivalent sub-circuits and building the second circuit N₂ is linear in a number of the first plurality of sub-circuits of the first circuit N₁.
 5. A method to implicitly reencode a multi-valued variable Y representing an output of a multi-valued function F of Boolean variables implemented by a Boolean circuit N₁, the method comprising: receiving a description of the first circuit N₁ including a specification of the partitioning of the first circuit into sub-circuits; replacing the first circuit N₁ with a second circuit N₂ corresponding to the specification and the partitioning of the first circuit N₁, wherein the second circuit N₂ implements the multi-valued function F; and synthesizing the second circuit N₂, wherein sub-circuits of the second circuit N₂ are respectively toggle equivalent sub-circuits to the sub-circuits of the first circuit N₁.
 6. The method of claim 5, further comprising: verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁.
 7. A method to implicitly reencode a multi-valued variable Y representing an output of a multi-valued function F of Boolean variables implemented by a Boolean circuit N₁, the method comprising: receiving a description of the first circuit N₁; replacing the first circuit N₁ with a second circuit N₂, wherein the second circuit N₂ implements the multi-valued function F synthesizing the second circuit N₂, wherein the second circuit N₂ is toggle equivalent to the first circuit N₁; verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ including computing a constraint function (D_(inp)) that relates inputs of the first circuit N₁ and the second circuit N₂.
 8. The method of claim 7, wherein verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ further comprises: computing a function (D_(out)) that relates outputs of the first circuit N₁ and the second circuit N₂.
 9. The method of claim 8, wherein verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ further comprises: checking whether the function D_(out) is a correlation function.
 10. A machine-readable medium that provides instructions that, when executed, will perform operations for integrated circuit design, the operaitons comprise: building a first circuit N₁ partitioned into a first plurality of sub-circuits corresponding to a specification, wherein the specification specifies the partitioning of the first circuit N₁ into sub-circuits and the connectivity of the sub-circuits; deriving a plurality of toggle equivalent sub-circuits respectively corresponding to the first plurality of sub-circuits of the first circuit N₁; and building a second circuit N₂ using the plurality of toggle equivalent sub-circuits in response to the specification, wherein the plurality of toggle equivalent sub-circuits form a partitioning of the second circuit N₂ corresponding to the specification and the partitioning of the first circuit N₁ into sub-circuits.
 11. The machine-readable medium of claim 10, wherein deriving the plurality of toggle equivalent sub-circuits comprises: for each of the first plurality of sub-circuits of the first circuit N₁: building a constraint function that relates one or more inputs of the corresponding sub-circuit to one or more inputs of the corresponding toggle equivalent sub-circuit of the second circuit N₂; synthesizing the next toggle equivalent sub-circuit of the second circuit N₂ based on the constraint function and a cost function; and computing a correlation function that relates outputs of the corresponding sub-circuit of the first circuit N₁ and outputs of the toggle equivalent sub-circuit of the second circuit N₂.
 12. The machine-readable medium of claim 11, wherein the correlation function is computed in response to the constraint function.
 13. The machine-readable medium of claim 10, wherein complexity of the deriving of the plurality of toggle equivalent sub-circuits and building the second circuit N₂ is linear in a number of the first plurality of sub-circuits of the first circuit N₁.
 14. A machine-readable medium that provides instructions that, when executed, will perform operations to implicitly reencode a multi-valued variable Y representing an output of a multi-valued function F of Boolean variables implemented by a first Boolean circuit N₁, the operations comprise: receiving a description of the first circuit N₁; and replacing the first circuit N₁ with a second circuit N₂ corresponding to the specification and the partitioning of the first circuit N₁, wherein the second circuit N₂ implements the multi-valued function F; and synthesizing the second circuit N₂, wherein sub-circuits of the second circuit N₂ are respectively toggle equivalent sub-circuits to the sub-circuits of the first circuit N₁.
 15. The machine-readable medium of claim 14, wherein the operations further comprise: verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁.
 16. A machine-readable medium that provides instructions that, when executed, will perform operations to implicitly reencode a multi-valued variable Y representing an output of a multi-valued function F of Boolean variables implemented by a first Boolean circuit N₁, the operations comprise: receiving a description of the first circuit N₁; replacing the first circuit N₁ with a second circuit N₂, wherein the second circuit N₂ implements the multi-valued function F; synthesizing the N₂, where the second circuit N₂ is toggle equivalent to the first circuit N₁; and verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ including computing a constraint function (D_(inp)) that relates inputs of the first circuit N₁ and the second circuit N₂.
 17. The machine-readable medium of claim 16, wherein verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ further comprises: computing a function (D_(out)) that relates outputs of the first circuit N₁ and the second circuit N₂.
 18. The machine-readable medium of claim 17, wherein verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ further comprises: checking whether the function D_(out) is a correlation function.
 19. A system comprising: a machine-readable medium to store instructions; and a processor, coupled to the machine-readable medium, to retrieve instructions from the machine-readable medium and, in response to the instructions retrieved, to perform operations for integrated circuit design, the operations comprising: building a first circuit (N₁) partitioned into a first plurality of sub-circuits corresponding to a specification, wherein the specification specifies the partitioning of the first circuit N₁ into sub-circuits and the connectivity of the sub-circuits; deriving a plurality of toggle equivalent sub-circuits respectively corresponding to the first plurality of sub-circuits of the first circuit N₁; and building a second circuit N₂ using the plurality of toggle equivalent sub-circuits in response to the specification, wherein the plurality of toggle equivalent sub-circuits form a partitioning of the second circuit N₂ corresponding to the specification and the partitioning of the first circuit N₁ into sub-circuits.
 20. The system of claim 19, wherein deriving the plurality of toggle equivalent sub-circuits comprises: for each of the first plurality of sub-circuits of the first circuit N₁; building a constraint function that relates one or more inputs of the corresponding sub-circuit to one or more inputs of the corresponding toggle equivalent sub-circuit of the second circuit N₂; synthesizing the next toggle equivalent sub-circuit of the second circuit N₂ based on the constraint function and a cost function; and computing a correlation function that relates outputs of the corresponding sub-circuit of the first circuit N₁ and outputs of the toggle equivalent sub-circuit of the second circuit N₂.
 21. The system of claim 20, wherein the correlation function is computed in response to the constraint function.
 22. The system of claim 19, wherein complexity of the deriving of the plurality of toggle equivalent sub-circuit and building the second circuit N₂ is linear in a number of the first plurality of sub-circuits of the first circuit N₁.
 23. A system comprising: a machine-readable medium to store instructions; and a processor, coupled to the machine-readable medium, to retrieve instructions from the machine-readable medium and, in response to the instructions retrieved, to perform operations to implicitly reencode a multi-valued variable Y representing an output of a multi-valued function F of Boolean variables implemented by a Boolean circuit N₁, the operations comprising: receiving a description of the first circuit N₁ including a specification of the partitioning of the first circuit into sub-circuits; replacing the first circuit N₁ with a second circuit N₂ corresponding to the specification and the partitioning of the first circuit N₁, wherein the second circuit N₂ implements the multi-valued function F; and synthesizing the second circuit N₂, wherein sub-circuits of the second circuit N₂ are respectively toggle equivalent sub-circuits to the sub-circuits of the first circuit N₁.
 24. The system of claim 23, wherein the operations further comprise: verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁.
 25. A system comprising: a machine-readable medium to store instructions; and a processor, coupled to the machine-readable medium, to retrieve instructions from the machine-readable medium and, in response to the instructions retrieved, to perform operations to implicitly reencode a multi-valued variable Y representing an output of a multi-valued function F of Boolean variables implemented by a Boolean circuit N₁, the operations comprising: receiving a description of the first circuit N₁; replacing the first circuit N₁ with a second circuit N₂, wherein the second circuit N₂ implements the multi-valued function F; synthesizing the second circuit N₂, where the second circuit N₂ is toggle equivalent to the first circuit N₁, and verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ including computing a constraint function (D_(inp)) that relates inputs of the first circuit N₁ and the second circuit N₂.
 26. The system of claim 25, wherein verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ further comprises: computing a function (D_(out)) that relates outputs of the first circuit N₁ and the second circuit N₂.
 27. The system of claim 26, wherein verifying that the second circuit N₂ is toggle equivalent to the first circuit N₁ further comprises: checking whether the function D_(out) is a correlation function. 